/*
 * Powered By dico
 * Since 2017 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.productActivityDetail.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.product.domain.ProductCusIndexVO;
import com.seeyoui.kensite.bussiness.orderlang.productActivityDetail.domain.ProductActivityDetail;
import com.seeyoui.kensite.bussiness.orderlang.productActivityDetail.persistence.ProductActivityDetailMapper;

/**
 * ProductActivityDetail
 * @author dico
 * @version 2.0
 * @since 1.0
 * @date 2018-03-06
 */

@Service
public class ProductActivityDetailService extends BaseService {
	
	@Autowired
	private ProductActivityDetailMapper productActivityDetailMapper;
	
	public List<ProductCusIndexVO> findIndexProductList(){
		return productActivityDetailMapper.findIndexProductList();
	}

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public ProductActivityDetail findOne(String id) throws CRUDException{
		return productActivityDetailMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param productActivityDetail
	 * @return
	 * @throws CRUDException
	 */
	public List<ProductActivityDetail> findList(ProductActivityDetail productActivityDetail) throws CRUDException {
		return productActivityDetailMapper.findList(productActivityDetail);
	}
	
	/**
	 * 查询所有数据集合
	 * @param productActivityDetail
	 * @return
	 * @throws CRUDException
	 */
	public List<ProductActivityDetail> findAll(ProductActivityDetail productActivityDetail) throws CRUDException {
		return productActivityDetailMapper.findAll(productActivityDetail);
	}
	
	/**
	 * 查询数据总数
	 * @param productActivityDetail
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(ProductActivityDetail productActivityDetail) throws CRUDException {
		return productActivityDetailMapper.findTotal(productActivityDetail);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param productActivityDetail
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(ProductActivityDetail productActivityDetail) throws CRUDException {
		return productActivityDetailMapper.findExTotal(productActivityDetail);
	}
	
	/**
	 * 数据新增
	 * @param productActivityDetail
	 * @throws CRUDException
	 */
	public void save(ProductActivityDetail productActivityDetail) throws CRUDException{
		productActivityDetail.preInsert();
		productActivityDetailMapper.save(productActivityDetail);
	}
	
	/**
	 * 数据修改
	 * @param productActivityDetail
	 * @throws CRUDException
	 */
	public void update(ProductActivityDetail productActivityDetail) throws CRUDException{
		productActivityDetail.preUpdate();
		productActivityDetailMapper.update(productActivityDetail);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		productActivityDetailMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param productActivityDetail
	 * @throws CRUDException
	 */
	public void remove(ProductActivityDetail productActivityDetail) throws CRUDException{
		productActivityDetail.preUpdate();
		productActivityDetailMapper.remove(productActivityDetail);			
	}
	
}